﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Default_Email.ascx.cs"
    Inherits="UserControl_Default_Email" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register Src="~/UserControl/CountDown.ascx" TagPrefix="uc1" TagName="countdown" %>
<%@ Register Src="~/UserControl/Gmap.ascx" TagName="Googlemap" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="GMaps" Namespace="Subgurim.Controles" TagPrefix="cc1" %>


<div class="" id="main-content">

    <script type="text/javascript">


        var seconds = "";
        setInterval(fun1, 1000);

        function fun1() {
            if (seconds == "")
                seconds = document.getElementById('<%=hdnseconds.ClientID %>').value;


            var days = Math.floor((parseInt(seconds) / (60 * 60 * 24)));
            var temp = Math.floor((parseInt(seconds) - (60 * 60 * 24 * parseInt(days))));
            var hours = Math.floor((parseInt(temp) / (60 * 60)));
            temp = Math.floor((parseInt(temp) - (60 * 60 * parseInt(hours))));
            var minitue = Math.floor((parseInt(temp) / (60)));
            temp = Math.floor((parseInt(temp) - ((60) * minitue)));



            document.getElementById("days").innerHTML = days;
            document.getElementById("hours").innerHTML = hours;
            document.getElementById("minitues").innerHTML = minitue;
            document.getElementById("seconds").innerHTML = temp;
            seconds = parseInt(seconds) - 1;


        }

        function Foo() {
            document.getElementById('<%=divAuthenticationEmail.ClientID %>').style.display = "block";
            return false;
        }
        function CloseGiftWindow() {
            document.getElementById('<%=divAuthenticationEmail.ClientID %>').style.display = "none";
            return false;
        }

        function popUpblock() {
            document.getElementById('<%=divSubcrigePopUp.ClientID %>').style.display = "none";
            MyWS.SubscribePopUpBlock("1", OnComplete);
            return false;
        }
        function OnComplete(args) {
            return true;
        }
    </script>

    <div class="body">
        <table id="main-body">
            <tbody>
                <tr>
                    <td class="content">
                        <div class="box-outer">
                            <div class="share-links">
                                Share this deal: <a href="" class="facebook" title="Share this deal with Facebook"
                                    id="FaceBook" runat="server" target="_blank">Facebook</a> <a href="" class="twitter"
                                        title="Share this deal with Twitter" id="Twiteer" runat="server" target="_blank">
                                        Twitter</a> <a href="" class="email" title="Share this deal with your Email" onclick="return Foo();">
                                            Email</a>
                            </div>
                            <div class="dealbox main box">
                                <div class="dealtitle">
                                    <span class="todays-deal">Today's Deal:</span> </asp:Label><asp:Label ID="lblDealTitle"
                                        runat="server" Text=""></asp:Label></div>
                                <table>
                                    <tbody>
                                        <tr>
                                            <td class="left">
                                                <div class="buybox">
                                                    <div class="buy">
                                                        <asp:Label ID="lblRegularPrice" runat="server" Text="$25" CssClass="cost"></asp:Label>
                                                        <asp:ImageButton ID="ImageButton1" runat="server" CssClass="buy_but" ImageUrl="../Images/buy_but.png"
                                                            OnClick="ImageButton1_Click" Visible="true" />
                                                        <asp:Image ID="ImageButton2" runat="server" ImageUrl="~/Images/sold_out.png" Visible="false" />
                                                    </div>
                                                    <table style="padding: 1px 0px;" class="numbers">
                                                        <tbody>
                                                            <tr>
                                                                <td class="price">
                                                                    <asp:Label ID="lblValue" runat="server"></asp:Label>
                                                                </td>
                                                                <td class="x">
                                                                    &nbsp;
                                                                </td>
                                                                <td class="discount">
                                                                    <asp:Label ID="lblDiscount" runat="server"></asp:Label>
                                                                </td>
                                                                <td class="eq">
                                                                    &nbsp;
                                                                </td>
                                                                <td class="save">
                                                                    <asp:Label ID="lblSave" runat="server"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Value
                                                                </td>
                                                                <td>
                                                                </td>
                                                                <td>
                                                                    Discount
                                                                </td>
                                                                <td>
                                                                </td>
                                                                <td>
                                                                    Savings
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                                <div class="countdown" id="timeCountDown" runat="server" visible="true">
                                                    <div class="cont">
                                                        <div id="days">
                                                        </div>
                                                        <div id="hours">
                                                        </div>
                                                        <div id="minitues">
                                                        </div>
                                                        <div id="seconds">
                                                        </div>
                                                        <input type="hidden" runat="server" id="hdnseconds" value="0" /></div>
                                                </div>
                                                <div style="clear: left; text-align: center; font-weight: bold; color: #003333; height: 25px;
                                                    margin: 10px 0 0 50px; font-size: 15px; text-align: center; float: left;">
                                                    <asp:Label ID="TotalPurchaseQty" runat="server" Text=""></asp:Label></div>
                                            </td>
                                            <td class="right">
                                                <div class="mainimg">
                                                    <asp:Image ID="DealImg" Height="299" Width="430" runat="server" ImageUrl="../images/product.jpg" />
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <table>
                                    <tbody>
                                        <tr>
                                            <td class="footprint">
                                                <h3>
                                                    Keep In Mind</h3>
                                                <asp:Label ID="txtFootPrint" runat="server" Text=""></asp:Label>
                                            </td>
                                            <td class="highlight">
                                                <h3>
                                                    Did You Know?</h3>
                                                <asp:Label ID="lblHighlights" runat="server" Text=""></asp:Label>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <div id="divSubcrigePopUp" runat="server" style="display: none;">
                                    <div id="Div1SubcrigePopUp" style="height: 1568px; left: 0; margin-left: 100; position: fixed;
                                        top: 0; width: 2007px; z-index: 10000; background-color: Black; opacity: 0.5;
                                        filter: Alpha(opacity=50); margin: 0px auto;">
                                    </div>
                                    <div id="Layer1" style="height: 1768px; left: 0; position: fixed; top: 0; width: 1007px;
                                        z-index: 20000; background-color: Transparent;">
                                        <div id="imgdivLoading" align="center" valign="middle" runat="server" style="padding: inherit;
                                            margin-left: 35%; margin-top: 25%; position: absolute; visibility: visible; vertical-align: middle;
                                            border: 2px solid #87ae53; width: 600px; height: 100px; background-color: #fff;
                                            font-family: Arial;">
                                            <div style="float: right; margin-top: -10px; right: -25px; top: 0;">
                                                <asp:ImageButton ID="imgClose" runat="server" Width="20px" Height="20px" ImageUrl="~/Images/cross.png"
                                                    OnClientClick="return popUpblock();" /></div>
                                            <div style="height: 40px; background-color: #ddedcc; padding-top: 10px;">
                                                <h1 style="text-align: center; font-size: 25px; color: #303030; margin: 0px 0 0 20px;">
                                                    <asp:Label ID="SubcribedCity" runat="server" Text=""></asp:Label>
                                                </h1>
                                            </div>
                                            <div>
                                                <h4 style="text-align: center; font-size: 18px; color: #303030; margin: 10px 0 0 0;">
                                                    You are now subscribed to receive our daily emails.</h4>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="box-inner">
                            </div>
                        </div>
                        <div class="companybox-outer">
                            <div class="companybox-inner">
                                <div id="companybox">
                                    <table class="main">
                                        <tbody>
                                            <tr>
                                                <td class="short">
                                                    <span class="large">
                                                        <div class="black">
                                                            Company Info:</div>
                                                    </span>
                                                    <asp:Label ID="lblVendor" runat="server" Text=""></asp:Label><br>
                                                    <a href="" id="website" target="_blank" runat="server">
                                                        <asp:Label ID="lblWebSite1" runat="server" Text="Website"></asp:Label></a><br>
                                                    <br>
                                                    <div class="black" id="Locations" runat="server" visible="False">
                                                        <b>Location(s):</b>
                                                    </div>
                                                    <div>
                                                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                                            <ContentTemplate>
                                                                <telerik:RadListView ID="RadAddressBox" runat="server" ItemPlaceholderID="ListViewContainer"
                                                                    Skin="Telerik" SkinID="Telerik" DataKeyNames="Address1,Address2,City,State,ZipCode,DealID">
                                                                    <LayoutTemplate>
                                                                        <asp:PlaceHolder runat="server" ID="ListViewContainer" />
                                                                    </LayoutTemplate>
                                                                    <ItemTemplate>
                                                                        <fieldset class="loc_link">
                                                                            <div style="font-size: small; word-wrap: break-word;">
                                                                                <asp:Label ID="Name" runat="server" Text='<%#Eval("Name")%>'></asp:Label><br />
                                                                                <asp:Label ID="Address1" runat="server" Text='<%#Eval("Address1")%>'></asp:Label>
                                                                                <asp:Label ID="Address2" runat="server" Text='<%#Eval("Address2")%>'></asp:Label><br />
                                                                                <asp:Label ID="City" runat="server" Text='<%#Eval("City")%>'></asp:Label>
                                                                                <asp:Label ID="State" runat="server" Text='<%#Eval("State")%>'></asp:Label>
                                                                                <asp:Label ID="ZipCode" runat="server" Text='<%#Eval("ZipCode")%>'></asp:Label><br />
                                                                                <asp:Label ID="PhoneNo" runat="server" Text='<%#Eval("PhoneNo")%>'></asp:Label><br />
                                                                                <a href='<%#"https://" + Eval("WebSite")%>' id="website" target="_blank" runat="server">
                                                                                    <asp:Label ID="lblWebSite" runat="server" Text='<%#Eval("WebSite")%>'></asp:Label></a>
                                                                                <br />
                                                                                <br />
                                                                                <a href='<%#"https://maps.google.com/maps?q=" + TrimDescription(Eval("Address1")as string,Eval("City") as string,Eval("State") as string,Eval("ZipCode") as string)%>'
                                                                                    id="A1" target="_blank" runat="server">
                                                                                    <asp:Label ID="Label1" runat="server" Text="Map It!" ForeColor="Red"></asp:Label>
                                                                                </a>
                                                                                <br />
                                                                                <br />
                                                                                <div style="cursor: pointer;">
                                                                                    <uc1:Googlemap ID="Googlemap1" runat="server" _Address1='<%#Eval("Address1")%>' _City='<%#Eval("City")%>'
                                                                                        _State='<%#Eval("State")%>' _GID='<%#Eval("DealAddressID")%>' />
                                                                                </div>
                                                                                <br>
                                                                                ----------------------
                                                                            </div>
                                                                        </fieldset>
                                                                    </ItemTemplate>
                                                                </telerik:RadListView>
                                                            </ContentTemplate>
                                                        </asp:UpdatePanel>
                                                    </div>
                                                </td>
                                                <td>
                                                    <span class="bold">Description:</span>
                                                    <br>
                                                    <p>
                                                        <asp:Label ID="lblDescription" runat="server"></asp:Label></p>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<div aria-labelledby="ui-dialog-title-emailthisdialog" role="dialog" tabindex="-1"
    class="ui-dialog ui-widget ui-widget-content ui-corner-all " style="display: none;
    position: absolute; overflow: hidden; z-index: 1000; outline: 0px none; margin-left: 200px;
    width: 300px;" id="divAuthenticationEmail" runat="server">
    <div style="-moz-user-select: none;" unselectable="on" class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
        <span style="-moz-user-select: none; width: 64px;" unselectable="on" id="ui-dialog-title-emailthisdialog"
            class="ui-dialog-title">Email This</span><a style="-moz-user-select: none;" unselectable="on"
                role="button" class="ui-dialog-titlebar-close ui-corner-all" href="" onclick="return CloseGiftWindow();"><span
                    style="-moz-user-select: none;" unselectable="on" class="ui-icon ui-icon-closethick">close</span></a></div>
    <div style="display: block;" id="emailthisdialog" class="hidden ui-dialog-content ui-widget-content">
        <form action="/emailthis" method="post" id="emailthisform">
        <input name="action" value="emailthis" type="hidden">
        <input name="deal" id="emailthisdeal" value="10004542" type="hidden">
        <p class="text red-text" id="emailthiserr">
        </p>
        <p class="text" id="emailthisgood">
        </p>
        <p class="text emailthis">
            <label for="emailthisto" class="first">
                <b>To:</b> (email address) <span class="err"></span>
            </label>
            <asp:TextBox ID="txtTo" runat="server" Width="250px"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtTo"
                ErrorMessage="To is required." ToolTip="To is required." ValidationGroup="Email">*</asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtTo"
                ErrorMessage="You must enter an valid email address" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                ValidationGroup="Email">*
            </asp:RegularExpressionValidator>
            <label for="emailthisfrom">
                <b>From:</b> (email address) <span class="err"></span>
            </label>
            <asp:TextBox ID="txtFrom" runat="server" Width="250px"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtFrom"
                ErrorMessage="From is required." ToolTip="To is required." ValidationGroup="Email">*</asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtFrom"
                ErrorMessage="You must enter an valid email address" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                ValidationGroup="Email">*
            </asp:RegularExpressionValidator>
            <label for="emailthissubject">
                <b>Subject:</b></label>
            <asp:TextBox ID="txtSubject" runat="server" Width="250px"></asp:TextBox>
            <label for="emailthisbody">
                <b>Message:</b></label>
            <asp:TextBox ID="txtMessage" runat="server" Width="250px" TextMode="MultiLine"></asp:TextBox>
        </p>
        </form>
    </div>
    <div>
        <asp:Button ID="btnGiftSave" runat="server" class="ui-state-default ui-corner-all"
            Text="Send" ValidationGroup="Email" OnClick="btnGiftSave_Click" />
        <asp:Button ID="btnCacel" runat="server" class="ui-state-default ui-corner-all" Text="Cancel"
            OnClientClick="return CloseGiftWindow();" CausesValidation="false" />
    </div>
</div>


